package com.wc.AlgoOJ_homework.AlgoOJ_BL4.K_异或和;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/4/6 11:04
 * @description http://43.138.190.70:8888/p/LQ1456?tid=660a4f84d7ba43eb2f4c549d
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 100010, M = N << 1;
    static int[] h = new int[N];
    static int[] ne = new int[M];
    static int[] e = new int[M];
    static int[] father = new int[N];
    static int[] a = new int[N];
    static int[] root = new int[N];
    static int idx = 1;
    static int n, m, u, v, x;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        for (int i = 1; i <= n; i++) {
            a[i] = sc.nextInt();
        }
        Set<Long> set = new HashSet<>();
        for (int i = 1; i < n; i++) {
            u = sc.nextInt();
            v = sc.nextInt();
            if (set.contains((long) u * N + v)) continue;
            set.add((long) u * N + v);
            add(u, v);
            add(v, u);
        }
        dfs(1, -1);
        while (m-- > 0) {
            x = sc.nextInt();
            u = sc.nextInt();
            if (x == 1) {
                v = sc.nextInt();
                int pre = a[u];
                a[u] = v;
                while (u > 0) {
                    root[u] ^= pre;
                    root[u] ^= v;
                    u = father[u];
                }
            } else {
                out.println(root[u]);
            }
        }
        out.flush();
    }

    static int dfs(int u, int fa) {
        int res = 0;
        res ^= a[u];
        for (int i = h[u]; i > 0; i = ne[i]) {
            int j = e[i];
            if (j != fa) {
                father[j] = u;
                res ^= dfs(j, u);
            }
        }
        return root[u] = res;
    }

    static void add(int a, int b) {
        e[idx] = b;
        ne[idx] = h[a];
        h[a] = idx++;
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
